package com.fsp.controller;

import com.fsp.domain.Demo;
import com.fsp.domain.Ebook;
import com.fsp.resp.CommonResp;
import com.fsp.service.DemoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author fushengping
 * @className DemoController
 * @description
 * @date 2021/7/26 12:33
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    @Resource
    private DemoService demoService;

    //查询demo的所有信息
    @GetMapping("/list")
    public CommonResp list(){
        CommonResp<Object> resp = new CommonResp<>();
        List<Demo> list = demoService.list();
        resp.setContent(list);
        return resp;
    }
}
